home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Powervisor v1.10b disk1.adf / s / pv / cmd.pv < prev    next >
Text File  |  1991-09-17  |  788b  |  39 lines

  1. /*=======================================================*/
  2. /*                                                                            */
  3. /* Execute cli commands from within PowerVisor        V1.0    */
  4. /*                                                                            */
  5. /* © Jorrit Tyberghein  17 Sep 1991                                */
  6. /*                                                                            */
  7. /*=======================================================*/
  8.  
  9. options results
  10.  
  11. 'string rc'
  12. cmd=result
  13.  
  14. ti=pragma('Id')
  15.  
  16. address command cmd '>t:cmd'ti
  17. if rc~=0 then
  18.     do
  19.         'print "Command failed with returncode' rc '!\0a"'
  20.         address command 'delete t:cmd'ti' >nil:'
  21.         exit
  22.     end
  23. if ~open(file,'t:cmd'ti,'R') then
  24.     do
  25.         address command 'delete t:cmd'ti' >nil:'
  26.         'print "Error opening file !\0a"'
  27.         exit
  28.     end
  29.  
  30. line=readln(file)
  31. do while ~eof(file)
  32.     'print "·Å'line'Å\0a"'
  33.     line=readln(file)
  34. end
  35.  
  36. call close file
  37. address command 'delete t:cmd'ti' >nil:'
  38. exit
  39.